﻿using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using UnitOfWorkEF.SqlServer.Domain;

namespace Microsoft.Extensions.DependencyInjection
{
    public static partial class UnitOfWorkSqlServerServiceCollectionExtensions
    {
        private class DefaultEntityTypeCollection : IEntityTypeCollection
        {
            List<IEntityTypeConfiguration<Entity>> _collection = new List<IEntityTypeConfiguration<Entity>>();
            public void Add(IEntityTypeConfiguration<Entity> entityType)
            {
                _collection.Add(entityType);
            }

            public void AddRange(IEnumerable<IEntityTypeConfiguration<Entity>> entityTypes)
            {
                _collection.AddRange(entityTypes);
            }
            public IEnumerable<IEntityTypeConfiguration<Entity>> GetCollection => _collection;
        }
    }
}
